<template>
  <div>



    <div>用户优惠券</div>

    <div style="border: 1px solid red; margin-top: 1px">
      <el-row :gutter="20">

        <el-col :span="6" v-for="(UserCoupon,index) in arr" >
          <el-card :body-style="{ padding: '0px' }">
            <div v-if="UserCoupon.state==0">
              <div class="value2">{{UserCoupon.value2}}</div>
              <div class="value2">减{{UserCoupon.value2}}</div>
              <div class="name">{{UserCoupon.name}}</div>
              <div class="shopName">{{UserCoupon.shopName}}</div>
              <div class="useStartTime">{{UserCoupon.useStartTime}}-{{UserCoupon.useEndTime}}</div>
            </div>
          </el-card><hr>
        </el-col><hr>
      </el-row>
    </div>

    <div style="border: 1px solid red; margin-top: 1px">
      <el-row :gutter="20">
        <h1>已使用</h1>
        <el-col :span="6" v-for="(UserAttrCoupon,index) in arr" >
          <el-card :body-style="{ padding: '0px' }">
            <div v-if="UserAttrCoupon.state==1">
              <div class="value2">{{UserAttrCoupon.value2}}</div>
              <div class="value2">减{{UserAttrCoupon.value2}}</div>
              <div class="name">{{UserAttrCoupon.name}}</div>
              <div class="shopName">{{UserAttrCoupon.shopName}}</div>
              <div class="useStartTime">{{UserAttrCoupon.useStartTime}}-{{UserAttrCoupon.useEndTime}}</div>
            </div>
          </el-card><hr>
        </el-col><hr>
      </el-row>
    </div>


    <div style="border: 1px solid red; margin-top: 1px">
      <el-row :gutter="20">
        <h1>已过期</h1>
        <el-col :span="6" v-for="(UserCoupons,index) in arr" >
          <el-card :body-style="{ padding: '0px' }">
            <div v-if="UserCoupons.state==2">
              <div class="value2">{{UserCoupons.value2}}</div>
              <div class="value2">减{{UserCoupons.value2}}</div>
              <div class="name">{{UserCoupons.name}}</div>
              <div class="shopName">{{UserCoupons.shopName}}</div>
              <div class="useStartTime">{{UserCoupons.useStartTime}}-{{UserCoupons.useEndTime}}</div>
            </div>
          </el-card><hr>
        </el-col><hr>
      </el-row>
    </div>


  </div>
</template>

<script>
//这里可以导入其他文件（比如：组件，工具js，第三方插件js，json文件，图片文件等等）,
//例如：import 《组件名称》 from '《组件路径》,
import {listUserCoupon} from "@/api/product/UserAttrCoupon";

export default {
    //import引入的组件需要注入到对象中才能使用"
    components: {},
    props: {},
    data() {
      //这里存放数据"

      return {
        arr:{},
        // 显示搜索条件
        showSearch: true,
        queryParams:{

        },
      };
    },
    //计算属性 类似于data概念",
    computed: {},
    //监控data中的数据变化",
    watch: {},
    //方法集合",
    methods: {
      /** 查询用户优惠券信息列表 */
      getList() {
        listUserCoupon(this.queryParams).then(response => {
          console.log(response)
          this.arr = response.data
        });
      },
    },
    //生命周期 - 创建完成（可以访问当前this实例）",
    created() {
      this.getList()
    },
    //生命周期 - 挂载完成（可以访问DOM元素）",
    mounted() {
    },
    beforeCreate() {
    }, //生命周期 - 创建之前",
    beforeMount() {
    }, //生命周期 - 挂载之前",
    beforeUpdate() {
    }, //生命周期 - 更新之前",
    updated() {
    }, //生命周期 - 更新之后",
    beforeDestroy() {
    }, //生命周期 - 销毁之前",
    destroyed() {
    }, //生命周期 - 销毁完成",
    activated() {
    } //如果页面有keep-alive缓存功能，这个函数会触发",
  };
</script>
<style lang="scss" scoped>
.product .value2{
  line-height: 20px;
  overflow: hidden;
  transition: height .08s ease;
  color: #666;
  cursor: pointer;
  font: 12px / 150% Tahoma,Arial,Microsoft YaHei,Hiragino Sans GB,"\u5b8b\u4f53",Sans-serif;
  -webkit-font-smoothing: antialiased;
}
</style>
